package com.ifonly.datatables.model;

/**
 * <p>
 * .
 * </p>
 *
 * @author Jerry Ou
 * @version 1.0 2015-08-31 14:46
 * @since JDK 1.6
 */
public class DTColumn {

    private String data;
    private String name;
    private boolean searchable;
    private boolean orderable;

    private Search search;

    public DTColumn() {
    }

    public DTColumn(String data, String name, boolean searchable, boolean orderable, Search search) {
        this.data = data;
        this.name = name;
        this.searchable = searchable;
        this.orderable = orderable;
        this.search = search;
    }


    public static class Search {
        private String value;
        private boolean regex;

        public Search() {
        }

        public Search(String value, boolean regex) {
            this.value = value;
            this.regex = regex;
        }

        public String getValue() {
            return value;
        }

        public boolean isRegex() {
            return regex;
        }

        @Override
        public String toString() {
            return "Search{" +
                    "value='" + value + '\'' +
                    ", regex=" + regex +
                    '}';
        }
    }


    public String getData() {
        return data;
    }

    public String getName() {
        return name;
    }

    public boolean isSearchable() {
        return searchable;
    }

    public boolean isOrderable() {
        return orderable;
    }

    public Search getSearch() {
        return search;
    }

    @Override
    public String toString() {
        return "DTColumn{" +
                "search=" + search +
                ", orderable=" + orderable +
                ", searchable=" + searchable +
                ", name='" + name + '\'' +
                ", data='" + data + '\'' +
                '}';
    }
}
